package models

import (
	"time"
)

// OrderLogs 订单操作记录表
type OrderLogs struct {
	Id          int       `gorm:"column:id;type:int(11);primary_key;AUTO_INCREMENT;comment:日志ID" json:"id"`
	OrderNo     string    `gorm:"column:order_no;type:varchar(255);default:0;comment:关联订单ID;NOT NULL" json:"order_no"`
	Action      string    `gorm:"column:action;type:varchar(100);comment:操作类型（创建、修改、删除、支付、发货等）;NOT NULL" json:"action"`
	Operator    string    `gorm:"column:operator;type:varchar(50);comment:操作人;NOT NULL" json:"operator"`
	Detail      string    `gorm:"column:detail;type:text;comment:操作详情" json:"detail"`
	CreatedTime time.Time `gorm:"column:created_time;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"created_time"`
	UpdatedTime time.Time `gorm:"column:updated_time;type:timestamp;default:CURRENT_TIMESTAMP;NOT NULL" json:"updated_time"`
}

func (o *OrderLogs) TableName() string {
	return "order_logs"
}
